package main

import (
	"fmt"
	"time"
)

func DoSomething() {
	var ticker *time.Ticker
	ticker = time.NewTicker(1 * time.Second)
	//defer ticker.Stop()
timer:=time.NewTimer(10*time.Second)
	for {
		select {
		case <-ticker.C:
			fmt.Println("hello")
		case <-timer.C:
			fmt.Println("stop")
			ticker.Stop()
		default:
			time.Sleep(time.Second)
			fmt.Println("world")
		}
	}
}
